package com.lc.afbx.activity;

import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.lc.afbx.R;
import com.lc.afbx.conn.Conn;
import com.lc.afbx.conn.GetApiYouJingXi;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.util.UtilToast;

/**
 * Created by Administrator on 2016/5/19.
 */
public class SurperiseActivity extends BaseActivity implements View.OnClickListener {

    private WebView surperise_web;
    private SimpleDraweeView surperise_iv;
    private String url = Conn.SERVICE;

    private GetApiYouJingXi getApiYouJingXi = new GetApiYouJingXi(new AsyCallBack<GetApiYouJingXi.Info>() {

        @Override
        public void onSuccess(String toast, int type, GetApiYouJingXi.Info info) throws Exception {

            surperise_iv.setImageURI(Uri.parse(info.data.picurl));
            surperise_web.loadUrl(url + info.data.web);
        }

        @Override
        public void onFail(String toast, int type) throws Exception {

            UtilToast.show(context, toast);

        }
    });

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_surperise);

        surperise_web = ((WebView) findViewById(R.id.surperise_web));
        surperise_iv = ((SimpleDraweeView) findViewById(R.id.surperise_iv));

        getApiYouJingXi.execute(this);


    }


    @Override
    public void onClick(View view) {

        switch (view.getId()) {

            case R.id.back:
                finish();
                return;


        }


    }




}
